(Fformat): Don't extend text properties from arguments
authorGerd Moellmann <gerd@gnu.org>
Mon, 22 Jan 2001 13:10:20 +0000 (13:10 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 22 Jan 2001 13:10:20 +0000 (13:10 +0000)
to padding chars in the result.

src/editfns.c

index 1871c54d2b7044a2a922ff411809add4198c34a7..590d177133846dbf8c1c2eab79b8e15028fd9245 100644 (file)
@@ -3310,9 +3310,8 @@ Use %% to put a single % into the output.")
 
          if (STRINGP (args[n]))
            {
-             int padding, nbytes;
+             int padding, nbytes, start, end;
              int width = lisp_string_width (args[n], -1, NULL, NULL);
-             int start = nchars;
 
              /* If spec requires it, pad on right with spaces.  */
              padding = minlen - width;
@@ -3320,9 +3319,11 @@ Use %% to put a single % into the output.")
                while (padding-- > 0)
                  {
                    *p++ = ' ';
-                   nchars++;
+                   ++nchars;
                  }
 
+             start = nchars;
+             
              if (p > buf
                  && multibyte
                  && !ASCII_BYTE_P (*((unsigned char *) p - 1))
@@ -3334,6 +3335,7 @@ Use %% to put a single % into the output.")
                                  STRING_MULTIBYTE (args[n]), multibyte);
              p += nbytes;
              nchars += XSTRING (args[n])->size;
+             end = nchars;
 
              if (negative)
                while (padding-- > 0)
@@ -3354,7 +3356,7 @@ Use %% to put a single % into the output.")
                    }
 
                  info[n].start = start;
-                 info[n].end = nchars;
+                 info[n].end = end;
                }
            }
          else if (INTEGERP (args[n]) || FLOATP (args[n]))